package com.vdong.data.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.vdong.data.model.Users;
import com.vdong.data.repository.UsersRepository;
import com.vdong.data.service.UsersService;

@Service
public class UsersServiceImpl implements UsersService {

    @Autowired
    private UsersRepository usersRepository;

    @Override
    // @Cacheable(value = "users", key = "#key")
    public Users findByKey(String key) {

        return usersRepository.findByKey(key);

    }

    @Override
    public Users add(Users users) {
        return usersRepository.save(users);

    }

}
